<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<style>
		a{text-decoration: none;}
	.maina{
		width:795px;
		overflow-x:hidden;
	}
	.maina .refer{
		width:795px;
		height:55px;
		line-height:55px;
		border-bottom:1px solid #57A5B9;
		text-align:left;
	}
	.refer span , .refer a{
		display:inline-block;
		*display:inline;
		zoom:1;
		margin-left:10px;
		color:#2C5F6C;
	}
	.refer .r1{
		width:40px;
		font-size:16px;
		line-height:20px;
		vertical-align:middle;
	}
	.refer input{
		width:122px;
		height:27px;
		border:1px solid #ddd;
		padding-left:5px;
	}
	.refer a{
		width:72px;
		height:30px;
		line-height:30px;
		text-align:center;
		color:#fff;
		background: #787878;
		border-radius: 5px;
	}
	.maina table{
		width:795px;
	}
	.maina table .title th{
		height:35px;
		line-height:35px;
		background:#bbb;
		color:#333;
		text-align:center;
		border-bottom:1px solid #6FB3C4;
	}
	.maina table tr td{
		height:32px;
		line-height:32px;
		text-align:center;
		overflow:hidden;
		color:#444;
		font-size:12px;
		border-bottom:1px solid #6FB3C4;
	}
	.maina table tr td a{
		color:#444;
	}
	.maina table tr td a:hover{
		color:#2C5F6C;
	}
	.maina table tr:nth-child(2n+1) td{
		background:#e5e5e7;
	}
	/*分页*/
	.page{
		width:795px;
		height:60px;
		text-align:center;
	}
	.page a , .page span{
		display:inline-block;
		*display:inline;
		zoom:1;
		margin-left:3px;
		margin-right:3px;
		color:#2C5F6C;
		margin-top:8px;
	}
	.page a{
		padding:2px 6px;
		border:1px solid #d9d9d9;
		border-radius:3px;
		-moz-border-radius:3px;
		-webkit-border-radius:3px;
		min-width:15px;
	}
	</style>
</head>
<?php 
    header("Content-Type:text/html;charset=utf-8");
    include 'includes/init.php';
    include_once 'includes/upload.class.php';
    error_reporting(E_ERROR | E_PARSE);
    session_start();

    $id=isset($_SESSION['id'])?$_SESSION['id']:'';

    if ($_SESSION['rule_id'] == 5){
        $sql = "select * from t_product";
        $infoAll = $db_Obj->getall($sql);
    } else {
        $sql = "SELECT * FROM t_product WHERE mid = {$id}";
        $infoAll = $db_Obj->getall($sql);
    }

 ?>
<body>
<a href="index.php" style="margin-left:10px;"><<<返回列表</a><br>
	<div class="maina">
    <!--查询-->
    <table border="0" cellpadding="0" cellspacing="0">
        <tr class="title">
            <th width="110" scope="col">物料编码</th>
            <th width="80" scope="col">项目名称</th>
            <th width="80" scope="col">截至日期</th>
            <th width="50" scope="col">竞价状态</th>
            <th width="50" scope="col">密封状态</th>
            <th width="80" scope="col">未税目标单价</th>
            <th width="145" scope="col">操作</th>
        </tr>
      <?php foreach ($infoAll as $key => $value) {  ?>
        <tr>
            <td><?php echo $value['type']; ?></td>
            <td><?php echo $value['project']; ?></td>
            <td><?php echo date('Y-m-d H:i:s',$value['lasttime']); ?></td>
            <td>
                <?php if($value['status'] == 0){ ?>
                    <?php echo "非竞价"; ?>
                <?php }else{  ?>
                    <?php echo "竞价"; ?>
                <?php } ?>
            </td>
            <td>
                <?php if($value['mifeng'] == 0){ ?>
                    <?php echo "非密封"; ?>
                <?php }else{  ?>
                    <?php echo "密封"; ?>
                <?php } ?>
            </td>
            <td><?php echo $value['price']; ?></td>
            <td><a href="prolist_detail.php?pid=<?php echo $value['pid']; ?>">编辑</a>&nbsp;|&nbsp;<a href="prolist_model.php?pid=<?php echo $value['pid']; ?>">删除</a></td>
          </tr>
      <?php } ?>
     
    </table>
</div>
</body>
</html>